<?php

declare(strict_types=1);

namespace app\api\controller\v1;
use app\common\Frontend;
use app\common\model\PublicStatus;
use app\common\model\VipPrice;
use app\common\model\VipType;

class Vip extends Frontend
{

    protected array $noNeedLogin = [];

    protected $model;
    protected $price;
    public function initialize(): void
    {
        parent::initialize();
        $this->model = new VipType();
        $this->price = new VipPrice();
    }


    //类型数据源
    public function vipTypeList() : void {
        $res =$this->model->with(['price'])->where(['status'=>PublicStatus::PUBLIC_STATUS_ONE])->limit(2)->select()->each(function($item,$key){
            $item['full_url'] = full_url($item['url']);
            return $item;
        })->toArray();
        $this->success('', [
            'list'   => [
                'result' => $res,
                'payType'=>PublicStatus::payType()
            ],
            'remark' => '',
        ]);
    }
}